#!/usr/local/bin/perl -w
use strict;
use Template;
require JCL;
#use CGI;

$|=1;
print "Content-type: text/html\n\n";

my $file = 'ana.html';

my $mmdd=$ENV{'QUERY_STRING'};

my $vars = {
    'filelist' => &JCL::get_file_list("/home/ftpuser/$mmdd"),
###               must passing array ref. to template toolkit not array
#    'cgi'      => CGI->new(),
};


my $template = Template->new({
    INCLUDE_PATH => '/usr/lib/cgi-bin/src:/usr/lib/cgi-bin/lib',
    PRE_PROCESS  => 'config',
});

$template->process($file, $vars)
    || die $template->error();

